<script>
import { Edit } from "../Cells/transfer.js";
import { h, inject, ref, shallowRef } from "vue";
import DargBox from './DargBox.vue'
export default {
  props: ['item'],
  setup(props) {


    const RenderChild = function (slots) {
      var Obj = {};
      for (const key in slots) {
        const element = slots[key];
        Obj[key] = function () {
          var _list = [];
          for (let i = 0; i < element.length; i++) {
            const item = element[i];
            _list.push(h(DargBox, { item: item }));
          }
          return _list;
        };
      }
      return Obj;
    };

    return () => h(Edit[props.item.type], { props: props.item.props }, props.item.slots && RenderChild(props.item.slots));
  }
}

</script>